﻿function addClass(value){var classNames,i,l,elem,className,setClass,c,cl;if(jQuery.isFunction(value))return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")||""))});if(value&&typeof value=="string")for(classNames=(value||"").split(rspace),i=0,l=this.length;i<l;i++)if(elem=this[i],elem.nodeType===1)if(elem.className){for(className=" "+elem.className+" ",setClass=elem.className,c=0,cl=classNames.length;c<cl;c++)className.indexOf(" "+classNames[c]+" ")<0&&(setClass+=" "+classNames[c]);elem.className=jQuery.trim(setClass)}else elem.className=value;return this}function(){alert("Hi!")}